public class Array3 {
   
    public static int k;
    public static int[][] a;
   
    public Array3(int n, int m) {
        a = new int[n][m];
        for (int i = 0; i<n; i++)
            for (int j = 0; j<m; j++)
                a[i][j]=(int)(Math.random() * 8 + Math.random() * 5);
      //  show();   
    }
   
    public static void show(){
        System.out.println("Matrix : " + a.length + " �� " + a[0].length);
                for (int i = 0; i < a.length; i++) {
                for (int j = 0; j < a[0].length; j++)
                System.out.print(a[i][j] + " ");
                System.out.println();
                }
            }
   
    public static void PutArray(int[][] array){
        for (int i = 0; i < array.length; i++)
                    for (int j = 0; j < array[0].length-1; j++){
                        int search_min=array[i][j];
                        CheckRow (search_min, i, j, j+1, array);
                    }
    }
   
   
    public static void CheckRow(int m, int m1, int m2, int m3, int[][] array){
        for(int i=m1;i<array.length;i++)
            for (int j = m3; j < array[0].length; j++){
                if (m > array[i][j]){
                    array[i][m2]=array[i][j];
                    array[i][j]=m;
                    m=array[i][m2];
                }
               
            }
           
       
    }

}
